// 创建一个路由器，并暴露出去
 
// 引入createRouter
import {createRouter,createWebHistory} from 'vue-router'
 
//引入可能会用到的组件
import LoginPage from '@/components/LoginPage.vue'
import MainPage from '@/components/MainPage.vue'
import MyPage from '@/components/MyPage.vue'
import RegisterPage from '@/components/RegisterPage.vue'
import HelloWorld from '@/components/HelloWorld.vue'
import WelcomeItem from '@/components/WelcomeItem.vue'
import index from '@/layout/index.vue'


/**
 * constantRoutes
 * a base page that does not have permission requirements
 * all roles can be accessed
 */
//路由表
export const routes = [
    {path:'/LoginPage', component: LoginPage},
    {path:'/MainPage', component: MainPage},
    {path:'/MyPage', component: MyPage},
    {path:'/RegisterPage', component: RegisterPage},
    {path:'/HelloWorld', component: HelloWorld},
    {path:'/WelcomeItem', component: WelcomeItem},
    {path:'/index', component: index}
]

//路由器
const router = createRouter({
    history: createWebHistory(),
    routes
})

//暴露出去router
export default router